import Vue from 'vue'
import VueRouter from 'vue-router'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    component: function () {
      return import('../views/HomeView.vue')
    }

  },
  {
    path: '/tmap',

    component: () => import('../views/TmapView.vue')
  },
  {
    path: '/ueditor',

    component: () => import('../views/UeditorView.vue')
  }
  ,

  {
    path: '/chart',

    component: () => import('../views/ResponsiveChart.vue')
  },
  //MenuBar
  {
    path: '/menu',

    component: () => import('../views/MenuBar.vue')
  },
  {
    path: '/cope',

    component: () => import('../views/DeepCope.vue')
  },
  {
    path: '/promise',

    component: () => import('../views/PromiseXx.vue')
  }
  ,
  {
    path: '/upload',

    component: () => import('../views/UploadView.vue')
  }
  , {
    path: '/biaoqian',

    component: () => import('../views/BiaoQian.vue')
  }
  , {
    path: '/foreachmap',

    component: () => import('../views/forEachMap.vue')
  }, {
    path: '/EncryPtion',

    component: () => import('../views/EncryPtion.vue')
  }, {
    path: '/copy',

    component: () => import('../views/DeepCopy.vue')
  }, {
    path: '/mppx',

    component: () => import('../views/maopaoPaixu.vue')
  }, {
    path: '/cc1',
    name: 'cc1',

    component: () => import('../views/ChuanCan/ChuanCan1.vue')
  }, {
    path: '/cc2/:id',
    name: 'cc2',
    component: () => import('../views/ChuanCan/ChuanCan2.vue')
  }, {
    path: '/cz',
    component: () => import('../views/ChuanZhi/ZhuYemian.vue')
  }, {
    path: '/fg',
    component: () => import('../views/FenGe.vue')
  }, {
    path: '/vuex',
    component: () => import('../views/VuexView.vue')
  }
  , {
    path: '/guan',
    component: () => import('../views/GuanwenView.vue')
  }, {
    path: '/yx',
    component: () => import('../views/YingXiong.vue')
  },
  {
    path: '/gdmap',
    component: () => import('../views/GaoDeMap.vue')
  },
  ,
  {
    path: '/tianmap',
    component: () => import('../views/TianMap.vue')
  }, {
    path: '/Three',
    component: () => import('../views/ThreeMxing.vue')
  }, {
    path: '/jianting',
    component: () => import('../views/lianxi/JianTing.vue')
  },
  , {
    path: '/shujuleixing',
    component: () => import('../views/lianxi/ShuJuleixing.vue')
  }, {
    path: '/tongjidd',
    component: () => import('../views/TongJiddView.vue')
  },
  //EcView
  , {
    path: '/ecview',
    component: () => import('../views/EcView.vue')
  },
  , {
    path: '/tubiao',
    component: () => import('../views/TuBuaoView.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
NProgress.configure({ showSpinner: false })
router.beforeEach((to, from, next) => {
  NProgress.start();
  next();

});



router.afterEach(() => {
  NProgress.done();
});
export default router
